Detecting the methods under test in java (2005)
we observedtwo testpatternsthatlooksimilarbutaretheinverseofeach other.The rstconsistsofaninitialsetupmethod andthenfocusesononeorseveralmethods.Thesecondoneinvokesthefocusedmethod rstandthenusesaccessorstotestthesidee ects
JUnit がテストケースを見つける仕組み (2005年の話?)
JUnit tests that use a common xture are group ed into a sub class TestCase . Eac h test in suc h a class is a public metho d, whose name starts with \test" and tak es no argumen ts.
code:java
package com.acme.test.billing;
public class BillTest extends TestCase {
public void testAddItem() {
...
}
}
// The PUT is com.acme.billing, the CUT is Bill, and in the testAddItem test the MUT is addItem
package under test の発見
So for example org.jhotdraw.test.samples.net would become org.jhotdraw.samples.net whereas org.apache.ant.taskdefs.cond would remain the same.
package com.acme.test.billing; なので、テスト対象のpackage は com.acme.billing
Class under test
class BillTest から Test を取り除く
上で発見した Pakcage の下の Bill class を探して、あればそれが CUT
なかったら...?
Method under test
testAddItem -> addItem